<template>
	<view>
		<view class="box">
			<ul>
				<li v-for="(item,index) in userList" :key="index" @click="hrefCardDetail">
					<view class="info_name">
						<b>{{item.xming0}}</b><span>{{item.xming0}}</span>
					</view>
					<view class="info_card">{{item.kh0000}}</view>
					<view class="info_default">
						默认
					</view>
					<image src="../../static/266@2x.png" />
				</li>
				<!-- <li @click="hrefCardDetail">
					<view class="info_name">
						<b>张三</b>
						<span>本人</span>
					</view>
					<view class="info_default">
						默认
					</view>
					<view class="info_card"><span>3711111111111111111111</span></view>
					<image @click="qcode" src="../../static/266@2x.png" />
				</li> -->
			</ul>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userList:[]
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(){
				let user=uni.getStorageSync("user");
				let params={
					kh0000:user.sfzh00,
					xming0:user.xming0,
					funid:"F07.02.02.04"
				}
				this.$postJson("/qnyesb/qnyesbproxy",params,res=>{
					if(res.state==0){
						this.userList=res.data.retrieve;
					}else{
						uni.showModal({
							title:"温馨提示",
							content:"您尚未关联就诊人，是否现在去关联",
							success(res) {
								if(res.confirm){
									uni.navigateTo({
										url:"../bindInfo/bindInfo"
									})
								}else{
									uni.switchTab({
										url:"../index/index"
									})
								}
							}
						})
					}
				})
			},
			hrefCardDetail(){
				uni.navigateTo({
					url:"./medicalCard"
				})
			}
		}
	}
</script>

<style>
.box{
	width: 100%;
}
.box ul{
	width: 100%;
	display: grid;
}
.box ul li{
	position: relative;
	border-radius: 0px 0px 4px 4px;
	width: 82%;
	margin: 0 auto;
	background-color: #FFFFFF;
	margin-top: 10px;
	padding: 30px;
}
.box ul li image{
	width: 28px;
	height: 28px;
	float: right;
	margin-top: -15px;
}
.box ul li .info_name{
	float: left;
	width: 51%;
}
.box ul li .info_card{
	float: left;
	width: 50%;
}
.box ul li .info_default{
	position: absolute;
	background-color: #00A500;
	color:#FFFFFF;
	border-radius: 0px 4px 0px 4px;
	right: 0;
	top: 0;
	width: 70px;
	text-align: center;
	height: 25px;
	font-size: 14px;
	line-height: 25px;
}

</style>
